package com.hujun.modules.demo;

import com.alibaba.fastjson.JSON;
import com.hujun.modules.data.CustomData;
import com.hujun.modules.dto.BookDTO;
import com.hujun.utils.date.LocalDateUtils;
import com.hujun.utils.tree.TreeUtils;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

public class Demo {

    public static void main(String[] args) {

        LocalDate localDate = LocalDateUtils.convertToLocalDate("2023-12-14");
        System.out.println(localDate);
        LocalDateTime localDateTime = LocalDateUtils.convertToLocalDateTime("2023-12-14 14:00:50");
        System.out.println(localDateTime);

        List<BookDTO> bookList = CustomData.getBookList();
        System.out.println(bookList);
        List<BookDTO> treeList = TreeUtils.toTreeList(bookList);
        System.out.println(JSON.toJSONString(treeList));
    }
}
